package com.itheima.reggie.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.itheima.reggie.dto.DishDto;
import com.itheima.reggie.pojo.Dish;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface DishMapper extends BaseMapper<Dish> {

    /**
     * 条件分页查询
     * @param dtoPage
     * @param name
     * @return
     */
    Page<DishDto> pageDishDto(Page<DishDto> dtoPage, String name);

    /**
     * 根据id查询回显
     * @param id
     * @return
     */
    DishDto getDishDtoById(Long id);

    //
    List<DishDto> listDishDto(@Param("categoryId") Long categoryId, @Param("name") String name);
}
